package com.zkingsoft.web.tag;

import java.util.Comparator;

import com.zkingsoft.web.bean.ProductAttrDef;

public class AttrDefComparator  implements Comparator<ProductAttrDef> {
	@Override
	public int compare(ProductAttrDef o1, ProductAttrDef o2) {
		if (o1.getSequence() == null) {
			o1.setSequence(0);
		}
		if (o2.getSequence() == null) {
			o2.setSequence(0);
		}
		System.out.println(o1.getSequence() - o2.getSequence());
		return o2.getSequence().compareTo(o1.getSequence()) ;
	}

}
